package com.icinfo.cloud.provider.punish.common.documentoperate.service;

import com.icinfo.cloud.provider.punish.common.documentoperate.dto.*;
import com.icinfo.cloud.provider.punish.common.documentoperate.vo.CorrectionDocSaveVo;
import com.icinfo.cloud.provider.punish.common.documentoperate.vo.DocumentCommonFormDataVo;
import com.icinfo.cloud.provider.punish.common.documentoperate.vo.DocumentCommonFormHtmlVo;
import com.icinfo.cloud.provider.punish.common.seal.dto.FileSealInfoQueryDto;
import com.icinfo.framework.common.web.Result;

import java.util.Map;

/**
 * 描述：文书阶段公共操作接口
 *
 * @author xiangyuyu
 * @date 2022/2/16 21:07
 */
public interface IStageDocCommonOperateService {
    /**
     * 【V1.0.0】描述：保存文书信息通用接口
     *
     * @param saveDto {@link StageDocCommonOperateSaveDto}
     * @return {@link Result <String>} 保存结果
     * @author xiangyuyu
     * @date 2022-02-16 20:58
     */
    Map<String, Object> saveDocInfo(StageDocCommonOperateSaveDto saveDto);

    /**
     * 描述：保存补正/更正文书信息
     *
     */
    CorrectionDocSaveVo saveCorrectionDocInfo(CorrectionDocSaveDto saveDto);

    /**
     * 保存补正/更正送达回证
     * @param saveDetailDto
     */
    void saveCorrectionConfirmSend(CorrectionDocSaveDetailDto saveDetailDto);

    /**
     * 获取文书html公共方法
     *
     * @param request
     * @return {@link Result< String>}
     * @author liyafeng
     * @date 2022/2/18
     */
    DocumentCommonFormHtmlVo getDocumentFormHtml(StageDocCommonHtmlRequest request);

    /**
     * 获取通用文书表单数据
     *
     * @param request 请求
     * @return {@link DocumentCommonFormDataVo }
     * @author shishengyao
     * @date 2022/03/06
     */
    DocumentCommonFormDataVo getCommonDocumentFormData(StageDocCommonHtmlRequest request);

    /**
     * 获取通用文书表单数据(根据documentRecordId)
     *
     * @param request 请求
     * @return {@link DocumentCommonFormDataVo }
     */
    DocumentCommonFormDataVo getDocFormDataByDocRecordId(StageDocCommonHtmlRequest request);

    /**
     * 描述：【V1.0.0】文书文号生成
     *
     * @author tianrunjia
     * @date 2022-02-23
     */
    Map<String,Object> getDocumentNumber(String caseId, String documentCatalogCode, String partyId);

    /**
     * 描述：【V1.1.0】生成预览文书
     *
     * @param saveDto
     * @return {@link Map< String, Object>}
     * @author liyafeng
     * @date 2022/3/30
     */
    Map<String, Object> genPreviewDoc(StageDocCommonPreviewDto saveDto);

    /**
     * 重新生成文书
     *
     * @param paramJson param json
     * @return int
     * @author shishengyao
     * @date 2022/04/24
     */
    Result<Map<String, Object>> rebuildPdf(Map<String, Object> paramJson);

    /**
     * @Author: zhengqiang
     * @Date: 2022/5/11
     * @Description: 文书预览
     * @param: saveDto
     * @return: java.util.Map<java.lang.String,java.lang.Object>
     **/
    Map<String, Object> getDocPreview(StageDocCommonOperateSaveDto saveDto);

    /**
     * 文件签章并上传到oss
     *
     * @param queryDto 查询dto
     * @return {@link Map<String, String> }
     * @author shishengyao
     * @date 2022/03/07
     */
    String dealFileSeal(FileSealInfoQueryDto queryDto);


    /**
     * 根据文书目录编码获取法人或个人文件模板code
     *
     * @param documentCatalogCode 文书目录编码
     * @param caseId              案件id
     * @param paramMap            其他参数map
     * @return {@link String}
     * @author liyafeng
     * @date 2022/3/1
     */
    String getTemplateCodeByDocumentCatalogCode(String documentCatalogCode, String caseId, Map<String, Object> paramMap, String partyId);

    /**
     * 获取转换生成pdf并上传到oss的地址
     *
     * @param pdfRequest pdf格式的请求
     * @return {@link String }
     * @author shishengyao
     * @date 2022/02/25
     */
    Map<String, String> getConvertedPdfUrl(FillAndConvertToPdfRequest pdfRequest);
    /**
     * 自动保存
     * @author liyafeng
     * @date 2022/12/14
      * @param saveDto
     * @return {@link Map< String, Object>}
     */
    Map<String, Object> saveDocInfoAuto(StageDocCommonOperateSaveDto saveDto);

    /**
     * 获取APP直通车文书文号
     * @param busiId
     * @param documentKindCode
     * @param lineCode
     * @param lineTypeCode
     * @return
     */
    String getDocumentNumberForAppCar(String busiId, String documentKindCode, String lineCode, String lineTypeCode);

    String getCaseRevokePunishContent(String caseId);
}
